//
//  StatusBottomView.swift
//  weibo
//
//  Created by 上官风雨 on 15/11/14.
//  Copyright © 2015年 上官风雨. All rights reserved.
//

import UIKit
import SnapKit

class StatusBottomView: UIView {
    
    func btnDidClick(){
        
        let temp = TempViewController()
        
        retweetedBtn.navController()?.pushViewController(temp, animated: false)
        
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = UIColor(white: 0.9, alpha: 1.0)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI(){
        addSubview(retweetedBtn)
        addSubview(composeBtn)
        addSubview(likeBtn)
        
        
        retweetedBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(snp_left)
            make.height.equalTo(snp_height)
            make.top.equalTo(snp_top)
        }
        
        let v1 = sepView()
        addSubview(v1)
        v1.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetedBtn.snp_right)
            make.width.equalTo(1)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(0.6)
            
        }
        
        
        composeBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(retweetedBtn.snp_right)
            make.height.equalTo(snp_height)
            make.top.equalTo(snp_top)
            make.width.equalTo(retweetedBtn.snp_width)
        }
        let v2 = sepView()
        addSubview(v2)
        v2.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(composeBtn.snp_right)
            make.width.equalTo(1)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(0.6)
            
        }
        likeBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(composeBtn.snp_right)
            make.right.equalTo(snp_right)
            make.height.equalTo(snp_height)
            make.top.equalTo(snp_top)
            make.width.equalTo(retweetedBtn.snp_width)
        }
        
        retweetedBtn.addTarget(self, action: "btnDidClick", forControlEvents: .TouchUpInside)
        
    }
    func sepView()->UIView{
        
        let v = UIView()
        v.backgroundColor = UIColor.darkGrayColor()
        return v
        
    }
    
    lazy var retweetedBtn :UIButton = UIButton(title: "转发", backImage: nil, color: UIColor.darkGrayColor(),image: "timeline_icon_retweet",size: 10)
    lazy var composeBtn :UIButton = UIButton(title: "评论", backImage: nil, color: UIColor.darkGrayColor(),image: "timeline_icon_comment",size: 10)
    lazy var likeBtn :UIButton = UIButton(title: "赞", backImage: nil, color: UIColor.darkGrayColor(),image: "timeline_icon_unlike",size: 10)
    
    
    
}
